﻿using System.ComponentModel;
using Loki.Commands;
using Loki.Utils;

namespace Loki.UI.Wpf
{
    public class TileViewModel : ViewModelBase
    {
        #region Header

        private static PropertyChangedEventArgs _HeaderChangedArgs = ObservableHelper.CreateChangedArgs<TileViewModel>(x => x.Header);

        private static PropertyChangingEventArgs _HeaderChangingArgs = ObservableHelper.CreateChangingArgs<TileViewModel>(x => x.Header);

        private string _Header;

        public string Header
        {
            get
            {
                return _Header;
            }

            set
            {
                if (value != _Header)
                {
                    NotifyChanging(_HeaderChangingArgs);
                    _Header = value;
                    NotifyChanged(_HeaderChangedArgs);
                }
            }
        }

        #endregion Header

        #region Command

        private static PropertyChangedEventArgs _CommandChangedArgs = ObservableHelper.CreateChangedArgs<TileViewModel>(x => x.Command);

        private static PropertyChangingEventArgs _CommandChangingArgs = ObservableHelper.CreateChangingArgs<TileViewModel>(x => x.Command);

        private ICommand _Command;

        public ICommand Command
        {
            get
            {
                return _Command;
            }

            set
            {
                if (value != _Command)
                {
                    NotifyChanging(_CommandChangingArgs);
                    _Command = value;
                    NotifyChanged(_CommandChangedArgs);
                }
            }
        }

        #endregion Command

        #region GroupHeader

        private static PropertyChangedEventArgs _GroupHeaderChangedArgs = ObservableHelper.CreateChangedArgs<TileViewModel>(x => x.GroupHeader);

        private static PropertyChangingEventArgs _GroupHeaderChangingArgs = ObservableHelper.CreateChangingArgs<TileViewModel>(x => x.GroupHeader);

        private string _GroupHeader;

        public string GroupHeader
        {
            get
            {
                return _GroupHeader;
            }

            set
            {
                if (value != _GroupHeader)
                {
                    NotifyChanging(_GroupHeaderChangingArgs);
                    _GroupHeader = value;
                    NotifyChanged(_GroupHeaderChangedArgs);
                }
            }
        }

        #endregion GroupHeader

        #region IsFlowBreak

        private static PropertyChangedEventArgs _IsFlowBreakChangedArgs = ObservableHelper.CreateChangedArgs<TileViewModel>(x => x.IsFlowBreak);

        private static PropertyChangingEventArgs _IsFlowBreakChangingArgs = ObservableHelper.CreateChangingArgs<TileViewModel>(x => x.IsFlowBreak);

        private bool _IsFlowBreak;

        public bool IsFlowBreak
        {
            get
            {
                return _IsFlowBreak;
            }

            set
            {
                if (value != _IsFlowBreak)
                {
                    NotifyChanging(_IsFlowBreakChangingArgs);
                    _IsFlowBreak = value;
                    NotifyChanged(_IsFlowBreakChangedArgs);
                }
            }
        }

        #endregion IsFlowBreak
    }
}